import HTTP from "@/tools/http";

const base = "/manage";


// 管理系统路由菜单
export const MenuList = (params) => HTTP.get(`/user/GetAdminRouterList`, { params });

// 认证列表
export const realList = (params) => HTTP.get(`${base}/realList`, { params });
// 拒绝认证
export const refuseReal = (data) => HTTP.post(`${base}/refuseReal`, data);
// 通过认证
export const passReal = (data) => HTTP.post(`${base}/passReal`, data);
// 重置认证
export const resetReal = (data) => HTTP.post(`${base}/resetReal`, data);
// 获取认证信息
export const realInfo = (params) => HTTP.get(`${base}/realInfo`, { params });

// 添加用户
export const addUser = (data) => HTTP.post(`${base}/addUser`, data);

// 用户列表
export const userList = (params) => HTTP.get(`${base}/list`, { params });

// 用户信息
export const userInfo = (params) => HTTP.get(`${base}/info`, { params });


// 登出用户
export const logout = (data) => HTTP.post(`${base}/logout`, data);

// 修改用户资料
export const update = (data) => HTTP.post(`${base}/update`, data);
// 删除用户
export const remove = (data) => HTTP.post("/manage/remove", data);
// 限制用户登录
export const restrictLogin = (data) => HTTP.post(`${base}/restrictLogin`, data);
// 取消限制登录
export const cancelRestrictLogin = (data) =>
  HTTP.post(`${base}/cancelRestrictLogin`, data);
// 修改用户角色
export const changeRole = (data) => HTTP.post("/manage/changeRole", data);
// 重置用户密码
export const resetPassword = (data) => HTTP.post("/manage/resetPassword", data);

// 用户类型列表
export const userTypeList = (params) =>
  HTTP.get(`${base}/userTypeList`, { params });
// 新增用户类型
export const AdduserTypeList = (data) => HTTP.post(`${base}/blackList`, data);
// 删除用户类型
export const RemoveUserTypeList = (data) =>
  HTTP.post(`${base}/blackList`, data);
// 修改用户类型
export const UpdateUserTypeList = (data) =>
  HTTP.post(`${base}/blackList`, data);

// 黑名单用户列表
export const blackList = (params) => HTTP.get(`${base}/blackList`, { params });
// 拉入黑名单
export const toBlack = (data) => HTTP.post(`${base}/toBlack`, data);
// 取消黑名单
export const cancelBlack = (data) => HTTP.post(`${base}/cancelBlack`, data);

// 获取用户token列表
export const getUserTokenList = (params) =>
  HTTP.get(`${base}/getUserTokenList`, { params });
// 删除用户token列表
export const removeUserToken = (data) =>
  HTTP.post(`${base}/removeUserToken`, data);
// 清空用户token列表
export const emptyUserToken = (data) =>
  HTTP.post(`${base}/emptyUserToken`, data);

// 获取用户行为日志
export const getUserActiveList = (params) =>
  HTTP.get(`${base}/getUserActiveList`, { params });
// 删除用户行为日志
export const removeUserActive = (data) =>
  HTTP.post(`${base}/removeUserActive`, data);
// 清空用户行为日志
export const emptyUserActive = (data) =>
  HTTP.post(`${base}/emptyUserActive`, data);

// 获取用户下线列表
export const getUserInviterList = (params) =>
  HTTP.get(`${base}/getUserInviterList`, { params });

// 获取用户地址库
export const userAddressList = (params) =>
  HTTP.get(`${base}/userAddressList`, { params });
// 删除用户地址库
export const removeUserAddress = (data) =>
  HTTP.post(`${base}/removeUserAddress`, data);
// 修改用户地址库
export const updateUserAddress = (data) =>
  HTTP.post(`${base}/updateUserAddress`, data);
// 清空用户地址库
export const emptyUserAddress = (data) =>
  HTTP.post(`${base}/emptyUserAddress`, data);

export default {
    MenuList,
  addUser,
  userList,
  userInfo,
  update,
  remove,
  restrictLogin,
  cancelRestrictLogin,
  blackList,
  toBlack,
  cancelBlack,
  getUserTokenList,
  removeUserToken,
  emptyUserToken,
  getUserActiveList,
  removeUserActive,
  emptyUserActive,
  userAddressList,
  removeUserAddress,
  updateUserAddress,
  emptyUserAddress,
  changeRole,
  resetPassword,
  userTypeList,
  AdduserTypeList,
  RemoveUserTypeList,
  UpdateUserTypeList,
  realList,
  refuseReal,
  passReal,
  resetReal,
  realInfo,
};
